<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.5"/>
<title>transwarp: transwarp::graph_pool&lt; Graph &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td style="padding-left: 0.5em;">
   <div id="projectname">transwarp
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.5 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="hierarchy.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Pages</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div id="nav-path" class="navpath">
  <ul>
<li class="navelem"><a class="el" href="namespacetranswarp.html">transwarp</a></li><li class="navelem"><a class="el" href="classtranswarp_1_1graph__pool.html">graph_pool</a></li>  </ul>
</div>
</div><!-- top -->
<div class="header">
  <div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#pub-methods">Public Member Functions</a> &#124;
<a href="classtranswarp_1_1graph__pool-members.html">List of all members</a>  </div>
  <div class="headertitle">
<div class="title">transwarp::graph_pool&lt; Graph &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p>A graph pool that allows running multiple instances of the same graph in parallel. Graph must be a sub-class of <a class="el" href="classtranswarp_1_1graph.html" title="A graph interface giving access to the final task as required by transwarp::graph_pool. ">transwarp::graph</a>.  
 <a href="classtranswarp_1_1graph__pool.html#details">More...</a></p>

<p><code>#include &lt;<a class="el" href="transwarp_8h_source.html">transwarp.h</a>&gt;</code></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:af8b416f9fe9c28c46c4a173ea976eefc"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="af8b416f9fe9c28c46c4a173ea976eefc"></a>
&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtranswarp_1_1graph__pool.html#af8b416f9fe9c28c46c4a173ea976eefc">graph_pool</a> (std::function&lt; std::shared_ptr&lt; Graph &gt;()&gt; generator, std::size_t <a class="el" href="classtranswarp_1_1graph__pool.html#a1f7bf5710f3665a79c796c68be409eeb">minimum_size</a>, std::size_t <a class="el" href="classtranswarp_1_1graph__pool.html#a03fe587272570a7194ced79e89a00310">maximum_size</a>)</td></tr>
<tr class="memdesc:af8b416f9fe9c28c46c4a173ea976eefc"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a graph pool by passing a generator to create a new graph and a minimum and maximum size of the pool. The minimum size is used as the initial size of the pool. Graph should be a subclass of <a class="el" href="classtranswarp_1_1graph.html" title="A graph interface giving access to the final task as required by transwarp::graph_pool. ">transwarp::graph</a>. <br/></td></tr>
<tr class="separator:af8b416f9fe9c28c46c4a173ea976eefc"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:abe4923a44799c79c641eff6ee2deefdd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="abe4923a44799c79c641eff6ee2deefdd"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>graph_pool</b> (const <a class="el" href="classtranswarp_1_1graph__pool.html">graph_pool</a> &amp;)=delete</td></tr>
<tr class="separator:abe4923a44799c79c641eff6ee2deefdd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2518d5c72eef6512b034bf6bf96d83bd"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2518d5c72eef6512b034bf6bf96d83bd"></a>
<a class="el" href="classtranswarp_1_1graph__pool.html">graph_pool</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (const <a class="el" href="classtranswarp_1_1graph__pool.html">graph_pool</a> &amp;)=delete</td></tr>
<tr class="separator:a2518d5c72eef6512b034bf6bf96d83bd"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a6dbdfe54e9f42b989aaa4d6dcbf71c81"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a6dbdfe54e9f42b989aaa4d6dcbf71c81"></a>
&#160;</td><td class="memItemRight" valign="bottom"><b>graph_pool</b> (<a class="el" href="classtranswarp_1_1graph__pool.html">graph_pool</a> &amp;&amp;)=delete</td></tr>
<tr class="separator:a6dbdfe54e9f42b989aaa4d6dcbf71c81"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a18f50efc1b199ab1151877463450a403"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a18f50efc1b199ab1151877463450a403"></a>
<a class="el" href="classtranswarp_1_1graph__pool.html">graph_pool</a> &amp;&#160;</td><td class="memItemRight" valign="bottom"><b>operator=</b> (<a class="el" href="classtranswarp_1_1graph__pool.html">graph_pool</a> &amp;&amp;)=delete</td></tr>
<tr class="separator:a18f50efc1b199ab1151877463450a403"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a3bc1099fcc4564fe54ac4ca8481c570e"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a3bc1099fcc4564fe54ac4ca8481c570e"></a>
std::shared_ptr&lt; Graph &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtranswarp_1_1graph__pool.html#a3bc1099fcc4564fe54ac4ca8481c570e">next_idle_graph</a> (bool maybe_resize=true)</td></tr>
<tr class="memdesc:a3bc1099fcc4564fe54ac4ca8481c570e"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the next idle graph. If there are no idle graphs then it will attempt to double the pool size. If that fails then it will return a nullptr. On successful retrieval of an idle graph the function will mark that graph as busy. <br/></td></tr>
<tr class="separator:a3bc1099fcc4564fe54ac4ca8481c570e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aa76d1b73b1a195880dc62ae162cba5e0"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aa76d1b73b1a195880dc62ae162cba5e0"></a>
std::shared_ptr&lt; Graph &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtranswarp_1_1graph__pool.html#aa76d1b73b1a195880dc62ae162cba5e0">wait_for_next_idle_graph</a> (bool maybe_resize=true)</td></tr>
<tr class="memdesc:aa76d1b73b1a195880dc62ae162cba5e0"><td class="mdescLeft">&#160;</td><td class="mdescRight">Just like <a class="el" href="classtranswarp_1_1graph__pool.html#a3bc1099fcc4564fe54ac4ca8481c570e" title="Returns the next idle graph. If there are no idle graphs then it will attempt to double the pool size...">next_idle_graph()</a> but waits for a graph to become available. The returned graph will always be a valid pointer. <br/></td></tr>
<tr class="separator:aa76d1b73b1a195880dc62ae162cba5e0"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a2ce9a7ccdd8469157e318d49da41c561"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a2ce9a7ccdd8469157e318d49da41c561"></a>
std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtranswarp_1_1graph__pool.html#a2ce9a7ccdd8469157e318d49da41c561">size</a> () const </td></tr>
<tr class="memdesc:a2ce9a7ccdd8469157e318d49da41c561"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the current total size of the pool (sum of idle and busy graphs) <br/></td></tr>
<tr class="separator:a2ce9a7ccdd8469157e318d49da41c561"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a1f7bf5710f3665a79c796c68be409eeb"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a1f7bf5710f3665a79c796c68be409eeb"></a>
std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtranswarp_1_1graph__pool.html#a1f7bf5710f3665a79c796c68be409eeb">minimum_size</a> () const </td></tr>
<tr class="memdesc:a1f7bf5710f3665a79c796c68be409eeb"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the minimum size of the pool. <br/></td></tr>
<tr class="separator:a1f7bf5710f3665a79c796c68be409eeb"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a03fe587272570a7194ced79e89a00310"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a03fe587272570a7194ced79e89a00310"></a>
std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtranswarp_1_1graph__pool.html#a03fe587272570a7194ced79e89a00310">maximum_size</a> () const </td></tr>
<tr class="memdesc:a03fe587272570a7194ced79e89a00310"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the maximum size of the pool. <br/></td></tr>
<tr class="separator:a03fe587272570a7194ced79e89a00310"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a8f9a8d3bf2ab43f044c65b16492bef4a"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a8f9a8d3bf2ab43f044c65b16492bef4a"></a>
std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtranswarp_1_1graph__pool.html#a8f9a8d3bf2ab43f044c65b16492bef4a">idle_count</a> () const </td></tr>
<tr class="memdesc:a8f9a8d3bf2ab43f044c65b16492bef4a"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of idle graphs in the pool. <br/></td></tr>
<tr class="separator:a8f9a8d3bf2ab43f044c65b16492bef4a"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9dfef1fd80b1f22f7cea0ed0adff8105"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="a9dfef1fd80b1f22f7cea0ed0adff8105"></a>
std::size_t&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtranswarp_1_1graph__pool.html#a9dfef1fd80b1f22f7cea0ed0adff8105">busy_count</a> () const </td></tr>
<tr class="memdesc:a9dfef1fd80b1f22f7cea0ed0adff8105"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the number of busy graphs in the pool. <br/></td></tr>
<tr class="separator:a9dfef1fd80b1f22f7cea0ed0adff8105"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aef63bfb345b1d2fb65377593cd2b2ba3"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aef63bfb345b1d2fb65377593cd2b2ba3"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtranswarp_1_1graph__pool.html#aef63bfb345b1d2fb65377593cd2b2ba3">resize</a> (std::size_t new_size)</td></tr>
<tr class="memdesc:aef63bfb345b1d2fb65377593cd2b2ba3"><td class="mdescLeft">&#160;</td><td class="mdescRight">Resizes the graph pool to the given new size if possible. <br/></td></tr>
<tr class="separator:aef63bfb345b1d2fb65377593cd2b2ba3"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aae01291cb76406fa70a11e3ff3719ffe"><td class="memItemLeft" align="right" valign="top"><a class="anchor" id="aae01291cb76406fa70a11e3ff3719ffe"></a>
void&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="classtranswarp_1_1graph__pool.html#aae01291cb76406fa70a11e3ff3719ffe">reclaim</a> ()</td></tr>
<tr class="memdesc:aae01291cb76406fa70a11e3ff3719ffe"><td class="mdescLeft">&#160;</td><td class="mdescRight">Reclaims finished graphs by marking them as idle again. <br/></td></tr>
<tr class="separator:aae01291cb76406fa70a11e3ff3719ffe"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<a name="details" id="details"></a><h2 class="groupheader">Detailed Description</h2>
<div class="textblock"><h3>template&lt;typename Graph&gt;<br/>
class transwarp::graph_pool&lt; Graph &gt;</h3>

<p>A graph pool that allows running multiple instances of the same graph in parallel. Graph must be a sub-class of <a class="el" href="classtranswarp_1_1graph.html" title="A graph interface giving access to the final task as required by transwarp::graph_pool. ">transwarp::graph</a>. </p>
</div><hr/>The documentation for this class was generated from the following file:<ul>
<li>src/<a class="el" href="transwarp_8h_source.html">transwarp.h</a></li>
</ul>
</div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.5
</small></address>
</body>
</html>
